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
e1dde4bd
Commit
e1dde4bd
authored
Nov 01, 2001
by
Bernd Eckenfels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delay the setting of netmask derived from /mask after setting address
(Debian Bug #116573 reported by Brian Warner)
parent
590aeaa5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
ifconfig.c
ifconfig.c
+11
-5
No files found.
ifconfig.c
View file @
e1dde4bd
...
...
@@ -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.5
3 2001/11/01 01:54:49
ecki Exp $
* Version: $Id: ifconfig.c,v 1.5
4 2001/11/01 03:00:13
ecki Exp $
*
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
* and others. Copyright 1993 MicroWalt Corporation
...
...
@@ -254,12 +254,13 @@ static int set_netmask(int skfd, struct ifreq *ifr, struct sockaddr *sa)
int
main
(
int
argc
,
char
**
argv
)
{
struct
sockaddr
sa
;
struct
sockaddr
samask
;
struct
sockaddr_in
sin
;
char
host
[
128
];
struct
aftype
*
ap
;
struct
hwtype
*
hw
;
struct
ifreq
ifr
;
int
goterr
=
0
,
didnetmask
=
0
;
int
goterr
=
0
,
didnetmask
=
0
,
neednetmask
=
0
;
char
**
spp
;
int
fd
;
#if HAVE_AFINET6
...
...
@@ -941,7 +942,7 @@ int main(int argc, char **argv)
/* FIXME: sa is too small for INET6 addresses, inet6 should use that too,
broadcast is unexpected */
if
(
ap
->
getmask
)
{
switch
(
ap
->
getmask
(
host
,
&
sa
,
NULL
))
{
switch
(
ap
->
getmask
(
host
,
&
sa
mask
,
NULL
))
{
case
-
1
:
usage
();
break
;
...
...
@@ -949,8 +950,8 @@ int main(int argc, char **argv)
if
(
didnetmask
)
usage
();
goterr
|=
set_netmask
(
skfd
,
&
ifr
,
&
sa
);
didnetmask
++
;
// remeber to set the netmask from samask later
neednetmask
=
1
;
break
;
}
}
...
...
@@ -1018,6 +1019,11 @@ int main(int argc, char **argv)
spp
++
;
}
if
(
neednetmask
)
{
goterr
|=
set_netmask
(
skfd
,
&
ifr
,
&
samask
);
didnetmask
++
;
}
if
(
opt_v
&&
goterr
)
fprintf
(
stderr
,
_
(
"WARNING: at least one error occured. (%d)
\n
"
),
goterr
);
...
...
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