Skip to content

Commit a76b1ad

Browse files
committed
confd: enable IFF_MULTICAST on GRE tunnel interfaces
Required for protocol daemons like ospfd to join multicast groups. Signed-off-by: Joachim Wiberg <[email protected]>
1 parent 777650b commit a76b1ad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/confd/src/infix-if-gre.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
int gre_gen(struct lyd_node *dif, struct lyd_node *cif, FILE *ip)
77
{
88
const char *local, *remote, *ttl, *tos, *pmtudisc;
9+
const char *ifname = lydx_get_cattr(cif, "name");
910
struct lyd_node *gre;
1011
int ipv6;
1112

@@ -15,8 +16,7 @@ int gre_gen(struct lyd_node *dif, struct lyd_node *cif, FILE *ip)
1516

1617
ipv6 = !!strstr(local, ":");
1718

18-
fprintf(ip, "link add name %s",
19-
lydx_get_cattr(cif, "name"));
19+
fprintf(ip, "link add name %s", ifname);
2020

2121
switch (iftype_from_iface(cif)) {
2222
case IFT_GRE:
@@ -45,5 +45,9 @@ int gre_gen(struct lyd_node *dif, struct lyd_node *cif, FILE *ip)
4545
fprintf(ip, " nopmtudisc");
4646

4747
fputc('\n', ip);
48+
49+
/* GRE interfaces don't have IFF_MULTICAST by default */
50+
fprintf(ip, "link set dev %s multicast on\n", ifname);
51+
4852
return 0;
4953
}

0 commit comments

Comments
 (0)