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
737f15f6
Commit
737f15f6
authored
Jul 08, 2005
by
shemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Thomas's ematch fixes for lex.
Fix more GCC signedness warnings.
parent
f332d169
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
33 additions
and
30 deletions
+33
-30
Makefile
Makefile
+1
-8
ip/ipneigh.c
ip/ipneigh.c
+1
-1
ip/xfrm_state.c
ip/xfrm_state.c
+1
-1
misc/ifstat.c
misc/ifstat.c
+5
-2
misc/nstat.c
misc/nstat.c
+3
-2
misc/rtacct.c
misc/rtacct.c
+8
-5
tc/emp_ematch.l
tc/emp_ematch.l
+11
-9
tc/emp_ematch.y
tc/emp_ematch.y
+1
-2
tc/m_ematch.h
tc/m_ematch.h
+2
-0
No files found.
Makefile
View file @
737f15f6
...
...
@@ -31,17 +31,10 @@ SUBDIRS=lib ip tc misc netem
LIBNETLINK
=
../lib/libnetlink.a ../lib/libutil.a
all
:
flex_check
Config
all
:
Config
@
for
i
in
$(SUBDIRS)
;
\
do
$(MAKE)
$(MFLAGS)
-C
$$
i
;
done
flex_check
:
@
if
[
-z
"
`
flex
-h
|
grep
'^Usage: flex '
`
"
]
;
then
\
echo
"GNU flex required, please install it."
;
\
echo
" see http://lex.sourceforge.net"
;
\
exit
1
;
\
fi
Config
:
sh configure
$(KERNEL_INCLUDE)
...
...
ip/ipneigh.c
View file @
737f15f6
...
...
@@ -166,7 +166,7 @@ static int ipneigh_modify(int cmd, int flags, int argc, char **argv)
addattr_l
(
&
req
.
n
,
sizeof
(
req
),
NDA_DST
,
&
dst
.
data
,
dst
.
bytelen
);
if
(
lla
&&
strcmp
(
lla
,
"null"
))
{
__u8
llabuf
[
16
];
char
llabuf
[
16
];
int
l
;
l
=
ll_addr_a2n
(
llabuf
,
sizeof
(
llabuf
),
lla
);
...
...
ip/xfrm_state.c
View file @
737f15f6
...
...
@@ -140,7 +140,7 @@ static int xfrm_algo_parse(struct xfrm_algo *alg, enum xfrm_attr_type_t type,
for
(
i
=
-
(
plen
%
2
),
j
=
0
;
j
<
len
;
i
+=
2
,
j
++
)
{
char
vbuf
[
3
];
char
val
;
__u8
val
;
vbuf
[
0
]
=
i
>=
0
?
p
[
i
]
:
'0'
;
vbuf
[
1
]
=
p
[
i
+
1
];
...
...
misc/ifstat.c
View file @
737f15f6
...
...
@@ -484,7 +484,7 @@ void update_db(int interval)
void
server_loop
(
int
fd
)
{
struct
timeval
snaptime
;
struct
timeval
snaptime
=
{
0
}
;
struct
pollfd
p
;
p
.
fd
=
fd
;
p
.
events
=
p
.
revents
=
POLLIN
;
...
...
@@ -498,6 +498,7 @@ void server_loop(int fd)
int
status
;
int
tdiff
;
struct
timeval
now
;
gettimeofday
(
&
now
,
NULL
);
tdiff
=
T_DIFF
(
now
,
snaptime
);
if
(
tdiff
>=
scan_interval
)
{
...
...
@@ -505,6 +506,7 @@ void server_loop(int fd)
snaptime
=
now
;
tdiff
=
0
;
}
if
(
poll
(
&
p
,
1
,
tdiff
+
scan_interval
)
>
0
&&
(
p
.
revents
&
POLLIN
))
{
int
clnt
=
accept
(
fd
,
NULL
,
NULL
);
...
...
@@ -535,7 +537,8 @@ void server_loop(int fd)
int
verify_forging
(
int
fd
)
{
struct
ucred
cred
;
int
olen
=
sizeof
(
cred
);
socklen_t
olen
=
sizeof
(
cred
);
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_PEERCRED
,
(
void
*
)
&
cred
,
&
olen
)
||
olen
<
sizeof
(
cred
))
return
-
1
;
...
...
misc/nstat.c
View file @
737f15f6
...
...
@@ -369,7 +369,7 @@ void update_db(int interval)
void
server_loop
(
int
fd
)
{
struct
timeval
snaptime
;
struct
timeval
snaptime
=
{
0
}
;
struct
pollfd
p
;
p
.
fd
=
fd
;
p
.
events
=
p
.
revents
=
POLLIN
;
...
...
@@ -422,7 +422,8 @@ void server_loop(int fd)
int
verify_forging
(
int
fd
)
{
struct
ucred
cred
;
int
olen
=
sizeof
(
cred
);
socklen_t
olen
=
sizeof
(
cred
);
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_PEERCRED
,
(
void
*
)
&
cred
,
&
olen
)
||
olen
<
sizeof
(
cred
))
return
-
1
;
...
...
misc/rtacct.c
View file @
737f15f6
...
...
@@ -68,7 +68,7 @@ struct rtacct_data
unsigned
long
long
val
[
256
*
4
];
double
rate
[
256
*
4
];
__u8
signature
[
128
];
char
signature
[
128
];
};
struct
rtacct_data
kern_db_static
;
...
...
@@ -363,13 +363,15 @@ void pad_kern_table(struct rtacct_data *dat, __u32 *ival)
void
server_loop
(
int
fd
)
{
struct
timeval
snaptime
;
struct
timeval
snaptime
=
{
0
}
;
struct
pollfd
p
;
p
.
fd
=
fd
;
p
.
events
=
p
.
revents
=
POLLIN
;
sprintf
(
kern_db
->
signature
,
"%d.%lu sampling_interval=%d time_const=%d"
,
getpid
(),
(
unsigned
long
)
random
(),
scan_interval
/
1000
,
time_constant
/
1000
);
sprintf
(
kern_db
->
signature
,
"%u.%lu sampling_interval=%d time_const=%d"
,
(
unsigned
)
getpid
(),
(
unsigned
long
)
random
(),
scan_interval
/
1000
,
time_constant
/
1000
);
pad_kern_table
(
kern_db
,
read_kern_table
(
kern_db
->
ival
));
...
...
@@ -411,7 +413,8 @@ void server_loop(int fd)
int
verify_forging
(
int
fd
)
{
struct
ucred
cred
;
int
olen
=
sizeof
(
cred
);
socklen_t
olen
=
sizeof
(
cred
);
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_PEERCRED
,
(
void
*
)
&
cred
,
&
olen
)
||
olen
<
sizeof
(
cred
))
return
-
1
;
...
...
tc/emp_ematch.l
View file @
737f15f6
...
...
@@ -5,6 +5,8 @@
extern int ematch_argc;
extern char **ematch_argv;
#define yylval ematch_lval
#define NEXT_EM_ARG() do { ematch_argc--; ematch_argv++; } while(0);
#define YY_INPUT(buf, result, max_size) \
...
...
@@ -37,27 +39,27 @@
%x str
%option 8bit stack warn
bison-bridge
noyywrap prefix="ematch_"
%option 8bit stack warn noyywrap prefix="ematch_"
%%
static unsigned char *strbuf;
static unsigned int strbuf_size;
static unsigned int strbuf_index;
static
inline
void strbuf_enlarge(void)
static void strbuf_enlarge(void)
{
strbuf_size += 512;
strbuf = realloc(strbuf, strbuf_size);
}
static
inline
void strbuf_append_char(unsigned char c)
static void strbuf_append_char(unsigned char c)
{
while (strbuf_index >= strbuf_size)
strbuf_enlarge();
strbuf[strbuf_index++] = c;
}
static
inline
void strbuf_append_charp(unsigned char *s)
static void strbuf_append_charp(unsigned char *s)
{
while (strbuf_index >= strbuf_size)
strbuf_enlarge();
...
...
@@ -81,8 +83,8 @@
<str>\" {
BEGIN(INITIAL);
yylval
->
b = bstr_new(strbuf, strbuf_index);
yylval
->
b->quoted = 1;
yylval
.
b = bstr_new(strbuf, strbuf_index);
yylval
.
b->quoted = 1;
return ATTRIBUTE;
}
...
...
@@ -132,11 +134,11 @@
[nN][oO][tT] return NOT;
"(" |
")" {
return yylval
->
i = *yytext;
return yylval
.
i = *yytext;
}
[^ \t\r\n()]+ {
yylval
->
b = bstr_alloc(yytext);
if (yylval
->
b == NULL)
yylval
.
b = bstr_alloc(yytext);
if (yylval
.
b == NULL)
return ERROR;
return ATTRIBUTE;
}
...
...
tc/emp_ematch.y
View file @
737f15f6
...
...
@@ -7,7 +7,6 @@
%}
%locations
%pure_parser
%token-table
%error-verbose
%name-prefix="ematch_"
...
...
@@ -19,7 +18,7 @@
}
%{
extern int
yylex(YYSTYPE *, YYLTYPE *
);
extern int
ematch_lex(void
);
extern void yyerror(char *s);
extern struct ematch *ematch_root;
extern char *ematch_err;
...
...
tc/m_ematch.h
View file @
737f15f6
...
...
@@ -2,6 +2,8 @@
#define __TC_EMATCH_H_
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "utils.h"
#include "tc_util.h"
...
...
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