Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
net-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
net-tools
Commits
ff42d595
Commit
ff42d595
authored
May 27, 2000
by
Phil Blundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check /proc before opening ECONET sockets.
Try to fix the problem with alias interfaces and non INET sockets.
parent
b94840d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
ifconfig.c
ifconfig.c
+15
-3
lib/econet.c
lib/econet.c
+2
-2
No files found.
ifconfig.c
View file @
ff42d595
...
...
@@ -3,7 +3,7 @@
* that either displays or sets the characteristics of
* one or more of the system's networking interfaces.
*
* Version: $Id: ifconfig.c,v 1.3
7 2000/05/21 19:35:34
pb Exp $
* Version: $Id: ifconfig.c,v 1.3
8 2000/05/27 17:36:16
pb Exp $
*
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
* and others. Copyright 1993 MicroWalt Corporation
...
...
@@ -144,16 +144,28 @@ static int set_flag(char *ifname, short flag)
static
int
clr_flag
(
char
*
ifname
,
short
flag
)
{
struct
ifreq
ifr
;
int
fd
;
if
(
strchr
(
ifname
,
':'
))
{
/* This is a v4 alias interface. Downing it via a socket for
another AF may have bad consequences. */
fd
=
get_socket_for_af
(
AF_INET
);
if
(
fd
<
0
)
{
fprintf
(
stderr
,
_
(
"No support for INET on this system.
\n
"
));
return
-
1
;
}
}
else
fd
=
skfd
;
strcpy
(
ifr
.
ifr_name
,
ifname
);
if
(
ioctl
(
sk
fd
,
SIOCGIFFLAGS
,
&
ifr
)
<
0
)
{
if
(
ioctl
(
fd
,
SIOCGIFFLAGS
,
&
ifr
)
<
0
)
{
fprintf
(
stderr
,
_
(
"%s: unknown interface: %s
\n
"
),
ifname
,
strerror
(
errno
));
return
-
1
;
}
strcpy
(
ifr
.
ifr_name
,
ifname
);
ifr
.
ifr_flags
&=
~
flag
;
if
(
ioctl
(
sk
fd
,
SIOCSIFFLAGS
,
&
ifr
)
<
0
)
{
if
(
ioctl
(
fd
,
SIOCSIFFLAGS
,
&
ifr
)
<
0
)
{
perror
(
"SIOCSIFFLAGS"
);
return
-
1
;
}
...
...
lib/econet.c
View file @
ff42d595
...
...
@@ -3,7 +3,7 @@
* support functions for the net-tools.
* (NET-3 base distribution).
*
* Version: $Id: econet.c,v 1.1
0 2000/05/20 13:38:10
pb Exp $
* Version: $Id: econet.c,v 1.1
1 2000/05/27 17:36:16
pb Exp $
*
* Author: Philip Blundell <philb@gnu.org>
*
...
...
@@ -80,7 +80,7 @@ struct aftype ec_aftype =
ec_print
,
ec_sprint
,
ec_input
,
NULL
,
NULL
,
NULL
,
NULL
,
-
1
,
NULL
/*"/proc/sys/net/econet"*/
"/proc/sys/net/econet"
};
#endif
/* HAVE_AFECONET */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment