diff options
Diffstat (limited to 'lib/sockopt.c')
| -rw-r--r-- | lib/sockopt.c | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/lib/sockopt.c b/lib/sockopt.c index e661b4cc56..83ea574833 100644 --- a/lib/sockopt.c +++ b/lib/sockopt.c @@ -13,10 +13,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with GNU Zebra; see the file COPYING. If not, write to the Free - * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. + * You should have received a copy of the GNU General Public License along + * with this program; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <zebra.h> @@ -29,29 +28,6 @@ #include "sockopt.h" #include "sockunion.h" -/* Replace the path of given defaultpath with newpath, but keep filename */ -void -set_socket_path (char *path, const char *defaultpath, char *newpath, int maxsize) -{ - const char *sock_name; - - sock_name = strrchr(defaultpath, '/'); - if (sock_name) - /* skip '/' */ - sock_name++; - else - /* - * VTYSH_PATH configured as relative path - * during config? Should really never happen for - * sensible config - */ - sock_name = defaultpath; - - strlcpy (path, newpath, maxsize); - strlcat (path, "/", maxsize); - strlcat (path, sock_name, maxsize); -} - void setsockopt_so_recvbuf (int sock, int size) { @@ -109,7 +85,6 @@ getsockopt_cmsg_data (struct msghdr *msgh, int level, int type) return NULL; } -#ifdef HAVE_IPV6 /* Set IPv6 packet info to the socket. */ int setsockopt_ipv6_pktinfo (int sock, int val) @@ -221,7 +196,6 @@ setsockopt_ipv6_tclass(int sock, int tclass) #endif return ret; } -#endif /* HAVE_IPV6 */ /* * Process multicast socket options for IPv4 in an OS-dependent manner. @@ -467,11 +441,9 @@ setsockopt_ifindex (int af, int sock, ifindex_t val) case AF_INET: ret = setsockopt_ipv4_ifindex (sock, val); break; -#ifdef HAVE_IPV6 case AF_INET6: ret = setsockopt_ipv6_pktinfo (sock, val); break; -#endif default: zlog_warn ("setsockopt_ifindex: unknown address family %d", af); } @@ -558,11 +530,9 @@ getsockopt_ifindex (int af, struct msghdr *msgh) case AF_INET: return (getsockopt_ipv4_ifindex (msgh)); break; -#ifdef HAVE_IPV6 case AF_INET6: return (getsockopt_ipv6_ifindex (msgh)); break; -#endif default: zlog_warn ("getsockopt_ifindex: unknown address family %d", af); return 0; @@ -669,7 +639,6 @@ sockopt_tcp_signature (int sock, union sockunion *su, const char *password) return 0; } -#ifdef HAVE_IPV6 /* If this does not work, then all users of this sockopt will need to * differentiate between IPv4 and IPv6, and keep seperate sockets for * each. @@ -686,7 +655,6 @@ sockopt_tcp_signature (int sock, union sockunion *su, const char *password) su2->sin6.sin6_addr.s6_addr32[2] = htonl(0xffff); memcpy (&su2->sin6.sin6_addr.s6_addr32[3], &su->sin.sin_addr, 4); } -#endif } memset (&md5sig, 0, sizeof (md5sig)); |
