kernel_route_add_v4(const unsigned char *pref, unsigned short plen,
const unsigned char *gate, int ifindex, unsigned int metric)
{
- unsigned int tmp_ifindex = ifindex; /* (for typing) */
struct zapi_ipv4 api; /* quagga's communication system */
struct prefix_ipv4 quagga_prefix; /* quagga's prefix */
struct in_addr babel_prefix_addr; /* babeld's prefix addr */
api.flags = 0;
api.message = 0;
api.safi = SAFI_UNICAST;
+
+ /* Unlike the native Linux and BSD interfaces, Quagga doesn't like
+ there to be both and IPv4 nexthop and an ifindex. Omit the
+ ifindex, and assume that the connected prefixes be set up
+ correctly. */
+
SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
api.nexthop_num = 1;
api.nexthop = &nexthop_pointer;
- SET_FLAG(api.message, ZAPI_MESSAGE_IFINDEX);
- api.ifindex_num = 1;
- api.ifindex = &tmp_ifindex;
+ api.ifindex_num = 0;
+
SET_FLAG(api.message, ZAPI_MESSAGE_METRIC);
api.metric = metric;
const unsigned char *gate, int ifindex,
unsigned int metric)
{
- unsigned int tmp_ifindex = ifindex; /* (for typing) */
struct zapi_ipv4 api; /* quagga's communication system */
struct prefix_ipv4 quagga_prefix; /* quagga's prefix */
struct in_addr babel_prefix_addr; /* babeld's prefix addr */
SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
api.nexthop_num = 1;
api.nexthop = &nexthop_pointer;
- SET_FLAG(api.message, ZAPI_MESSAGE_IFINDEX);
- api.ifindex_num = 1;
- api.ifindex = &tmp_ifindex;
+ api.ifindex_num = 0;
SET_FLAG(api.message, ZAPI_MESSAGE_METRIC);
api.metric = metric;