Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iproute2
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
iproute2
Commits
f082b64f
Commit
f082b64f
authored
Mar 30, 2005
by
net[shemminger]!shemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import patch addr-del
(Logical change 1.178)
parent
2cea8f2f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
3 deletions
+22
-3
ChangeLog
ChangeLog
+5
-0
include/utils.h
include/utils.h
+3
-0
ip/ipaddress.c
ip/ipaddress.c
+13
-3
lib/utils.c
lib/utils.c
+1
-0
No files found.
ChangeLog
View file @
f082b64f
2005-03-19 Thomas Graf <tgraf@suug.ch>
* Warn about wildcard deletions and provide IFA_ADDRESS upon
deletions to enforce prefix length validation for IPv4.
2005-03-30 Masahide NAKAMURA <nakam@linux-ipv6.org>
* ipv6 xfrm allocspi and monitor support.
...
...
include/utils.h
View file @
f082b64f
...
...
@@ -43,9 +43,12 @@ typedef struct
__u8
family
;
__u8
bytelen
;
__s16
bitlen
;
__u32
flags
;
__u32
data
[
4
];
}
inet_prefix
;
#define PREFIXLEN_SPECIFIED 1
#define DN_MAXADDL 20
#ifndef AF_DECnet
#define AF_DECnet 12
...
...
ip/ipaddress.c
View file @
f082b64f
...
...
@@ -744,6 +744,7 @@ int ipaddr_modify(int cmd, int argc, char **argv)
}
req
;
char
*
d
=
NULL
;
char
*
l
=
NULL
;
char
*
lcl_arg
=
NULL
;
inet_prefix
lcl
;
inet_prefix
peer
;
int
local_len
=
0
;
...
...
@@ -821,6 +822,7 @@ int ipaddr_modify(int cmd, int argc, char **argv)
usage
();
if
(
local_len
)
duparg2
(
"local"
,
*
argv
);
lcl_arg
=
*
argv
;
get_prefix
(
&
lcl
,
*
argv
,
req
.
ifa
.
ifa_family
);
if
(
req
.
ifa
.
ifa_family
==
AF_UNSPEC
)
req
.
ifa
.
ifa_family
=
lcl
.
family
;
...
...
@@ -838,9 +840,17 @@ int ipaddr_modify(int cmd, int argc, char **argv)
exit
(
1
);
}
if
(
peer_len
==
0
&&
local_len
&&
cmd
!=
RTM_DELADDR
)
{
peer
=
lcl
;
addattr_l
(
&
req
.
n
,
sizeof
(
req
),
IFA_ADDRESS
,
&
lcl
.
data
,
lcl
.
bytelen
);
if
(
peer_len
==
0
&&
local_len
)
{
if
(
cmd
==
RTM_DELADDR
&&
lcl
.
family
==
AF_INET
&&
!
(
lcl
.
flags
&
PREFIXLEN_SPECIFIED
))
{
fprintf
(
stderr
,
"Warning: Executing wildcard deletion to stay compatible with old scripts.
\n
"
\
" Explicitly specify the prefix length (%s/%d) to avoid this warning.
\n
"
\
" This special behaviour is likely to disappear in further releases,
\n
"
\
" fix your scripts!
\n
"
,
lcl_arg
,
local_len
*
8
);
}
else
{
peer
=
lcl
;
addattr_l
(
&
req
.
n
,
sizeof
(
req
),
IFA_ADDRESS
,
&
lcl
.
data
,
lcl
.
bytelen
);
}
}
if
(
req
.
ifa
.
ifa_prefixlen
==
0
)
req
.
ifa
.
ifa_prefixlen
=
lcl
.
bitlen
;
...
...
lib/utils.c
View file @
f082b64f
...
...
@@ -241,6 +241,7 @@ int get_prefix_1(inet_prefix *dst, char *arg, int family)
err
=
-
1
;
goto
done
;
}
dst
->
flags
|=
PREFIXLEN_SPECIFIED
;
dst
->
bitlen
=
plen
;
}
}
...
...
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