Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon
Commits
e797ad4c
Commit
e797ad4c
authored
2 years ago
by
Jan-Niklas Burfeind
Browse files
Options
Downloads
Patches
Plain Diff
gluon-radvd-filterd: fix c indentation
parent
36f40787
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
package/gluon-radv-filterd/src/gluon-radv-filterd.c
+20
-20
20 additions, 20 deletions
package/gluon-radv-filterd/src/gluon-radv-filterd.c
package/gluon-radv-filterd/src/mac.h
+2
-2
2 additions, 2 deletions
package/gluon-radv-filterd/src/mac.h
with
22 additions
and
22 deletions
package/gluon-radv-filterd/src/gluon-radv-filterd.c
+
20
−
20
View file @
e797ad4c
...
...
@@ -59,10 +59,10 @@
#ifdef DEBUG
#define CHECK(stmt) \
if(!(stmt)) { \
fprintf(stderr, "check failed: " #stmt "\n"); \
goto check_failed; \
}
if(!(stmt)) { \
fprintf(stderr, "check failed: " #stmt "\n"); \
goto check_failed; \
}
#define DEBUG_MSG(msg, ...) fprintf(stderr, msg "\n", ##__VA_ARGS__)
#else
#define CHECK(stmt) if(!(stmt)) goto check_failed;
...
...
@@ -78,8 +78,8 @@
#define foreach_safe(item, safe, list) \
for ((item) = (list); \
(item) && (((safe) = item->next) || 1); \
(item) = (safe))
(item) && (((safe) = item->next) || 1); \
(item) = (safe))
struct
router
{
struct
router
*
next
;
...
...
@@ -103,7 +103,7 @@ static struct global {
};
static
int
fork_execvp_timeout
(
struct
timespec
*
timeout
,
const
char
*
file
,
const
char
*
const
argv
[]);
const
char
*
const
argv
[]);
static
void
error_message
(
int
status
,
int
errnum
,
char
*
message
,
...)
{
va_list
ap
;
...
...
@@ -120,7 +120,7 @@ static void error_message(int status, int errnum, char *message, ...) {
}
static
int
timespec_diff
(
struct
timespec
*
tv1
,
struct
timespec
*
tv2
,
struct
timespec
*
tvdiff
)
struct
timespec
*
tvdiff
)
{
tvdiff
->
tv_sec
=
tv1
->
tv_sec
-
tv2
->
tv_sec
;
if
(
tv1
->
tv_nsec
<
tv2
->
tv_nsec
)
{
...
...
@@ -219,8 +219,8 @@ static int init_packet_socket(unsigned int ifindex) {
};
struct
sock_fprog
radv_filter
=
{
.
len
=
ARRAY_SIZE
(
radv_filter_code
),
.
filter
=
radv_filter_code
,
.
len
=
ARRAY_SIZE
(
radv_filter_code
),
.
filter
=
radv_filter_code
,
};
int
sock
=
socket
(
AF_PACKET
,
SOCK_DGRAM
|
SOCK_CLOEXEC
,
htons
(
ETH_P_IPV6
));
...
...
@@ -382,7 +382,7 @@ static void expire_routers(void) {
}
static
int
parse_tt_global
(
struct
nl_msg
*
msg
,
void
*
arg
__attribute__
((
unused
)))
void
*
arg
__attribute__
((
unused
)))
{
static
const
enum
batadv_nl_attrs
mandatory
[]
=
{
BATADV_ATTR_TT_ADDRESS
,
...
...
@@ -406,7 +406,7 @@ static int parse_tt_global(struct nl_msg *msg,
return
NL_OK
;
if
(
nla_parse
(
attrs
,
BATADV_ATTR_MAX
,
genlmsg_attrdata
(
ghdr
,
0
),
genlmsg_len
(
ghdr
),
batadv_genl_policy
))
{
genlmsg_len
(
ghdr
),
batadv_genl_policy
))
{
return
NL_OK
;
}
...
...
@@ -428,14 +428,14 @@ static int parse_tt_global(struct nl_msg *msg,
return
NL_OK
;
DEBUG_MSG
(
"Found originator for "
F_MAC
", it's "
F_MAC
,
F_MAC_VAR
(
router
->
src
),
F_MAC_VAR
(
mac_b
));
F_MAC_VAR
(
router
->
src
),
F_MAC_VAR
(
mac_b
));
router
->
originator
=
mac_b
;
return
NL_OK
;
}
static
int
parse_originator
(
struct
nl_msg
*
msg
,
void
*
arg
__attribute__
((
unused
)))
void
*
arg
__attribute__
((
unused
)))
{
static
const
enum
batadv_nl_attrs
mandatory
[]
=
{
...
...
@@ -460,7 +460,7 @@ static int parse_originator(struct nl_msg *msg,
return
NL_OK
;
if
(
nla_parse
(
attrs
,
BATADV_ATTR_MAX
,
genlmsg_attrdata
(
ghdr
,
0
),
genlmsg_len
(
ghdr
),
batadv_genl_policy
))
{
genlmsg_len
(
ghdr
),
batadv_genl_policy
))
{
return
NL_OK
;
}
...
...
@@ -481,7 +481,7 @@ static int parse_originator(struct nl_msg *msg,
return
NL_OK
;
DEBUG_MSG
(
"Found TQ for router "
F_MAC
" (originator "
F_MAC
"), it's %d"
,
F_MAC_VAR
(
router
->
src
),
F_MAC_VAR
(
router
->
originator
),
tq
);
F_MAC_VAR
(
router
->
src
),
F_MAC_VAR
(
router
->
originator
),
tq
);
router
->
tq
=
tq
;
if
(
router
->
tq
>
G
.
max_tq
)
G
.
max_tq
=
router
->
tq
;
...
...
@@ -490,7 +490,7 @@ static int parse_originator(struct nl_msg *msg,
}
static
int
parse_tt_local
(
struct
nl_msg
*
msg
,
void
*
arg
__attribute__
((
unused
)))
void
*
arg
__attribute__
((
unused
)))
{
static
const
enum
batadv_nl_attrs
mandatory
[]
=
{
BATADV_ATTR_TT_ADDRESS
,
...
...
@@ -512,7 +512,7 @@ static int parse_tt_local(struct nl_msg *msg,
return
NL_OK
;
if
(
nla_parse
(
attrs
,
BATADV_ATTR_MAX
,
genlmsg_attrdata
(
ghdr
,
0
),
genlmsg_len
(
ghdr
),
batadv_genl_policy
))
{
genlmsg_len
(
ghdr
),
batadv_genl_policy
))
{
return
NL_OK
;
}
...
...
@@ -528,7 +528,7 @@ static int parse_tt_local(struct nl_msg *msg,
return
NL_OK
;
DEBUG_MSG
(
"Found router "
F_MAC
" in transtable_local, assigning TQ %d"
,
F_MAC_VAR
(
router
->
src
),
LOCAL_TQ
);
F_MAC_VAR
(
router
->
src
),
LOCAL_TQ
);
router
->
tq
=
LOCAL_TQ
;
if
(
router
->
tq
>
G
.
max_tq
)
G
.
max_tq
=
router
->
tq
;
...
...
@@ -770,7 +770,7 @@ int main(int argc, char *argv[]) {
clock_gettime
(
CLOCK_MONOTONIC
,
&
now
);
if
(
G
.
routers
!=
NULL
&&
timespec_diff
(
&
now
,
&
next_update
,
&
diff
))
{
timespec_diff
(
&
now
,
&
next_update
,
&
diff
))
{
expire_routers
();
// all routers could have expired, check again
...
...
This diff is collapsed.
Click to expand it.
package/gluon-radv-filterd/src/mac.h
+
2
−
2
View file @
e797ad4c
...
...
@@ -15,7 +15,7 @@
&(var).ether_addr_octet[2], &(var).ether_addr_octet[3], \
&(var).ether_addr_octet[4], &(var).ether_addr_octet[5]
#define MAC2ETHER(_ether, _mac) memcpy((_ether).ether_addr_octet, \
(_mac), ETH_ALEN)
(_mac), ETH_ALEN)
#define ether_addr_equal(_a, _b) (memcmp((_a).ether_addr_octet, \
(_b).ether_addr_octet, ETH_ALEN) == 0)
(_b).ether_addr_octet, ETH_ALEN) == 0)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment