Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
1c152a25
Commit
1c152a25
authored
Nov 19, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move checking for V4-mapped addresses to util.c.
parent
c32f2f63
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
filter.c
filter.c
+1
-4
util.c
util.c
+9
-0
util.h
util.h
+1
-0
No files found.
filter.c
View file @
1c152a25
...
...
@@ -24,15 +24,12 @@ THE SOFTWARE.
#include "util.h"
#include "filter.h"
static
unsigned
char
v4prefix
[
16
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0xFF
,
0xFF
,
0
,
0
,
0
,
0
};
int
import_filter
(
const
unsigned
char
*
id
,
const
unsigned
char
*
prefix
,
unsigned
short
plen
,
const
unsigned
char
*
nexthop
)
{
if
(
plen
>=
96
&&
in_prefix
(
prefix
,
v4prefix
,
96
))
if
(
plen
>=
96
&&
v4mapped
(
prefix
))
return
1
;
return
0
;
...
...
util.c
View file @
1c152a25
...
...
@@ -275,3 +275,12 @@ martian_prefix(const unsigned char *prefix, int plen)
(
plen
>=
10
&&
prefix
[
0
]
==
0xFE
&&
(
prefix
[
1
]
&
0xC0
)
==
0x80
)
||
(
plen
>=
128
&&
memcmp
(
prefix
,
zeroes
,
16
)
==
0
);
}
static
unsigned
char
v4prefix
[
16
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0xFF
,
0xFF
,
0
,
0
,
0
,
0
};
int
v4mapped
(
const
unsigned
char
*
address
)
{
return
in_prefix
(
address
,
v4prefix
,
96
);
}
util.h
View file @
1c152a25
...
...
@@ -49,6 +49,7 @@ int parse_address(const char *address, unsigned char *addr_r);
int
parse_net
(
const
char
*
net
,
unsigned
char
*
prefix_r
,
unsigned
char
*
plen_r
);
int
wait_for_fd
(
int
direction
,
int
fd
,
int
msecs
);
int
martian_prefix
(
const
unsigned
char
*
prefix
,
int
plen
);
int
v4mapped
(
const
unsigned
char
*
address
);
/* If debugging is disabled, we want to avoid calling format_address
for every omitted debugging message. So debug is a macro. But
...
...
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