#! /bin/sh /usr/share/dpatch/dpatch-run ## fix_ip_common.h.dpatch by Nikolai Kondrashov ## ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Fixes #397584 @DPATCH@ diff -urNad iproute-20061002~/include/libnetlink.h iproute-20061002/include/libnetlink.h --- iproute-20061002~/include/libnetlink.h 2006-10-02 22:13:34.000000000 +0200 +++ iproute-20061002/include/libnetlink.h 2006-12-14 20:15:30.000000000 +0100 @@ -45,6 +45,8 @@ #define parse_rtattr_nested(tb, max, rta) \ (parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta))) +extern int rtm_get_table(struct rtmsg *r, struct rtattr **tb); + extern int rtnl_listen(struct rtnl_handle *, rtnl_filter_t handler, void *jarg); extern int rtnl_from_file(FILE *, rtnl_filter_t handler, diff -urNad iproute-20061002~/ip/ip_common.h iproute-20061002/ip/ip_common.h --- iproute-20061002~/ip/ip_common.h 2006-10-02 22:13:34.000000000 +0200 +++ iproute-20061002/ip/ip_common.h 2006-12-14 20:15:30.000000000 +0100 @@ -32,12 +32,4 @@ extern int do_multiroute(int argc, char **argv); extern int do_xfrm(int argc, char **argv); -static inline int rtm_get_table(struct rtmsg *r, struct rtattr **tb) -{ - __u32 table = r->rtm_table; - if (tb[RTA_TABLE]) - table = *(__u32*) RTA_DATA(tb[RTA_TABLE]); - return table; -} - extern struct rtnl_handle rth; diff -urNad iproute-20061002~/lib/libnetlink.c iproute-20061002/lib/libnetlink.c --- iproute-20061002~/lib/libnetlink.c 2006-10-02 22:13:34.000000000 +0200 +++ iproute-20061002/lib/libnetlink.c 2006-12-14 20:15:30.000000000 +0100 @@ -589,3 +589,11 @@ fprintf(stderr, "!!!Deficit %d, rta_len=%d\n", len, rta->rta_len); return i; } + +int rtm_get_table(struct rtmsg *r, struct rtattr **tb) +{ + __u32 table = r->rtm_table; + if (tb[RTA_TABLE]) + table = *(__u32*) RTA_DATA(tb[RTA_TABLE]); + return table; +}