]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
solaris: assume that IP forwarding is disabled
authorVincent Bernat <bernat@luffy.cx>
Wed, 8 May 2013 21:34:27 +0000 (23:34 +0200)
committerVincent Bernat <bernat@luffy.cx>
Wed, 8 May 2013 21:34:27 +0000 (23:34 +0200)
We don't know how to detect that while in the chroot.

src/daemon/forward-solaris.c

index d2fca55ecdaab82b5b76f534f3803a15bd45237a..de6ebc11a425920fbe377b8df17a11a9f8689284 100644 (file)
 
 int
 interfaces_routing_enabled(struct lldpd *cfg) {
-       int rc;
-       size_t iocsize = sizeof(mod_ioc_prop_t) + 1;
-       mod_ioc_prop_t *mip = calloc(1, iocsize);
-       if (mip == NULL) {
-               log_warn("interfaces", "unable to allocate memory for ioctl");
-               return -1;
-       }
-       mip->mpr_version = MOD_PROP_VERSION;
-       mip->mpr_flags = MOD_PROP_ACTIVE;
-       mip->mpr_proto = MOD_PROTO_IPV4;
-       mip->mpr_valsize = iocsize + 1 - sizeof(mod_ioc_prop_t);
-       strlcpy(mip->mpr_name, "forwarding", sizeof(mip->mpr_name));
-       struct strioctl ioc = {
-               .ic_cmd = SIOCGETPROP,
-               .ic_timout = 0,
-               .ic_len = iocsize,
-               .ic_dp = (char*)mip
-       };
-       if (ioctl(cfg->g_sock, I_STR, &ioc) == -1) {
-               free(mip);
-               log_debug("interfaces", "unable to get value for IPv4 forwarding");
-               return -1;
-       }
-
-       rc = (*mip->mpr_val == '1');
-       free(mip);
-       return rc;
+       /* Dunno how to get this for Solaris. See the commit introducing Solaris
+          support (maybe c3e340b6be8add4eb3a41882847a96e66793e82c) for a
+          solution which does not work in a chroot. */
+       return 0;
 }