Skip to content

Commit cb81e2a

Browse files
committed
clean code for alternate route in FIB
1 parent 88ad516 commit cb81e2a

File tree

5 files changed

+200
-218
lines changed

5 files changed

+200
-218
lines changed

include/net/nexthop.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,12 @@ struct nexthop {
8585
struct net *net;
8686

8787
u32 id;
88-
88+
u32 back_id;
8989
u8 protocol; /* app managing this nh */
9090
u8 nh_flags;
9191
bool is_group;
92-
bool has_back;
9392
bool is_back;
9493
bool is_prin;
95-
u32 prin_id;
96-
u32 back_id;
97-
struct nexthop *nh_prin;
98-
struct nexthop *nh_back;
9994
refcount_t refcnt;
10095
struct rcu_head rcu;
10196

@@ -105,7 +100,6 @@ struct nexthop {
105100
};
106101

107102
struct nh_info __rcu *nh_info_back;
108-
struct nh_info __rcu *nh_info_prin;
109103
};
110104

111105
/* caller is holding rcu or rtnl; no reference taken to nexthop */

include/uapi/linux/netlink.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ struct nlmsghdr {
6969
#define NLM_F_EXCL 0x200 /* Do not touch, if it exists */
7070
#define NLM_F_CREATE 0x400 /* Create, if it does not exist */
7171
#define NLM_F_APPEND 0x800 /* Add to end of list */
72+
#define NLM_F_ALTROUTE 0x1000 /* Add alternate route */
7273

7374
/* Modifiers to DELETE request */
7475
#define NLM_F_NONREC 0x100 /* Do not delete recursively */

include/uapi/linux/rtnetlink.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,6 @@ enum {
180180
RTM_GETVLAN,
181181
#define RTM_GETVLAN RTM_GETVLAN
182182

183-
// RTM_ALTROUTE = 116,
184-
//#define RTM_ALTROUTE RTM_ALTROUTE
185-
186-
187-
188183
__RTM_MAX,
189184
#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
190185
};
@@ -406,7 +401,7 @@ struct rtnexthop {
406401
#define RTNH_F_LINKDOWN 16 /* carrier-down on nexthop */
407402
#define RTNH_F_UNRESOLVED 32 /* The entry is unresolved (ipmr) */
408403
#define RTNH_F_BACK_LINK 64 /*Nexthop group has a backup link*/
409-
#define RTNH_F_DUMMY 128 /*Dummy nexthop*/
404+
410405

411406
#define RTNH_COMPARE_MASK (RTNH_F_DEAD | RTNH_F_LINKDOWN | RTNH_F_OFFLOAD)
412407

0 commit comments

Comments
 (0)