]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
kernel-pfroute: Try to ensure we get a source address or interface name
authorTobias Brunner <tobias@strongswan.org>
Mon, 17 Jun 2013 13:38:35 +0000 (15:38 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 21 Jun 2013 15:03:22 +0000 (17:03 +0200)
src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c

index 21bbf1ac22772bd11b99901e8f5945bff9a04405..b38a906bdabfee7bd4288f751c8a266fff6f4239 100644 (file)
@@ -1120,6 +1120,12 @@ static host_t *get_route(private_kernel_pfroute_net_t *this, bool nexthop,
                        case RTAX_IFA:
                                add_rt_addr(&msg.hdr, RTA_IFA, src);
                                break;
+                       case RTAX_IFP:
+                               if (!nexthop)
+                               {       /* add an empty IFP to ensure we get a source address */
+                                       add_rt_ifname(&msg.hdr, RTA_IFP, "");
+                               }
+                               break;
                        default:
                                break;
                }