}
/* Join AllSPFRouters */
- ospf6_sso (oi->interface->ifindex, &allspfrouters6, IPV6_JOIN_GROUP);
+ if (ospf6_sso (oi->interface->ifindex, &allspfrouters6, IPV6_JOIN_GROUP) < 0)
+ {
+ if (oi->sso_try_cnt++ < OSPF6_INTERFACE_SSO_RETRY_MAX)
+ {
+ zlog_info("Scheduling %s for sso retry, trial count: %d",
+ oi->interface->name, oi->sso_try_cnt);
+ thread_add_timer (master, interface_up, oi,
+ OSPF6_INTERFACE_SSO_RETRY_INT);
+ }
+ return 0;
+ }
+ oi->sso_try_cnt = 0; /* Reset on success */
/* Update interface route */
ospf6_interface_connected_route_update (oi->interface);
/* Interface State */
u_char state;
+ /* Interface socket setting trial counter, resets on success */
+ u_char sso_try_cnt;
+
/* OSPF6 Interface flag */
char flag;
#define OSPF6_INTERFACE_INSTANCE_ID 0
#define OSPF6_INTERFACE_BANDWIDTH 10000 /* Kbps */
#define OSPF6_REFERENCE_BANDWIDTH 100000 /* Kbps */
-
+#define OSPF6_INTERFACE_SSO_RETRY_INT 1
+#define OSPF6_INTERFACE_SSO_RETRY_MAX 5
/* Function Prototypes */
}
/* ospf6 set socket option */
-void
+int
ospf6_sso (u_int ifindex, struct in6_addr *group, int option)
{
struct ipv6_mreq mreq6;
ret = setsockopt (ospf6_sock, IPPROTO_IPV6, option,
&mreq6, sizeof (mreq6));
if (ret < 0)
- zlog_err ("Network: setsockopt (%d) on ifindex %d failed: %s",
- option, ifindex, safe_strerror (errno));
+ {
+ zlog_err ("Network: setsockopt (%d) on ifindex %d failed: %s",
+ option, ifindex, safe_strerror (errno));
+ return ret;
+ }
if ((ret = setsockopt (ospf6_sock, SOL_SOCKET, SO_SNDBUF,
&bufsize, sizeof (bufsize))) < 0)
{
zlog_err ("Couldn't increase raw wbuf size: %s\n", safe_strerror(errno));
+ return ret;
}
if ((ret = getsockopt (ospf6_sock, SOL_SOCKET, SO_SNDBUF,
&optval, &optlen)) < 0)
{
zlog_err ("getsockopt of SO_SNDBUF failed with error %s\n", safe_strerror(errno));
+ return ret;
}
else if (optval < bufsize)
{
&optval, &optlen)) < 0)
{
zlog_err ("getsockopt of SO_RCVBUF failed with error %s\n", safe_strerror(errno));
+ return ret;
}
else if (optval < bufsize)
{
zlog_err ("Unable to SO_RCVBUF to %d, set to %d\n", bufsize, optval);
}
+
+ return 0;
}
static int
extern void ospf6_set_checksum (void);
extern int ospf6_serv_sock (void);
-extern void ospf6_sso (u_int ifindex, struct in6_addr *group, int option);
+extern int ospf6_sso (u_int ifindex, struct in6_addr *group, int option);
extern int ospf6_sendmsg (struct in6_addr *, struct in6_addr *,
unsigned int *, struct iovec *);