diff -uNr openssh-3.6.1p2.orig/canohost.c openssh-3.6.1p2.llc/canohost.c --- openssh-3.6.1p2.orig/canohost.c 2003-01-06 21:51:23.000000000 -0200 +++ openssh-3.6.1p2.llc/canohost.c 2003-10-29 00:50:50.000000000 -0200 @@ -68,7 +68,7 @@ if (from.ss_family == AF_INET6) fromlen = sizeof(struct sockaddr_in6); - if (getnameinfo((struct sockaddr *)&from, fromlen, ntop, sizeof(ntop), + if (mygetnameinfo((struct sockaddr *)&from, fromlen, ntop, sizeof(ntop), NULL, 0, NI_NUMERICHOST) != 0) fatal("get_remote_hostname: getnameinfo NI_NUMERICHOST failed"); @@ -77,7 +77,7 @@ debug3("Trying to reverse map address %.100s.", ntop); /* Map the IP address to a host name. */ - if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name), + if (mygetnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name), NULL, 0, NI_NAMEREQD) != 0) { /* Host name not found. Use ip address. */ #if 0 @@ -117,7 +117,7 @@ } /* Look for the address from the list of addresses. */ for (ai = aitop; ai; ai = ai->ai_next) { - if (getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop2, + if (mygetnameinfo(ai->ai_addr, ai->ai_addrlen, ntop2, sizeof(ntop2), NULL, 0, NI_NUMERICHOST) == 0 && (strcmp(ntop, ntop2) == 0)) break; @@ -234,7 +234,7 @@ addrlen = sizeof(struct sockaddr_in6); /* Get the address in ascii. */ - if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop), + if (mygetnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop), NULL, 0, flags) != 0) { error("get_socket_address: getnameinfo %d failed", flags); return NULL; @@ -333,7 +333,7 @@ fromlen = sizeof(struct sockaddr_in6); /* Return port number. */ - if (getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0, + if (mygetnameinfo((struct sockaddr *)&from, fromlen, NULL, 0, strport, sizeof(strport), NI_NUMERICSERV) != 0) fatal("get_sock_port: getnameinfo NI_NUMERICSERV failed"); return atoi(strport); diff -uNr openssh-3.6.1p2.orig/channels.c openssh-3.6.1p2.llc/channels.c --- openssh-3.6.1p2.orig/channels.c 2003-10-26 18:54:18.000000000 -0200 +++ openssh-3.6.1p2.llc/channels.c 2003-10-29 00:52:04.000000000 -0200 @@ -128,7 +128,7 @@ #define NUM_SOCKS 10 -/* AF_UNSPEC or AF_INET or AF_INET6 */ +/* AF_UNSPEC or AF_INET or AF_INET6 or AF_LLC */ static int IPv4or6 = AF_UNSPEC; /* helper */ @@ -2047,13 +2047,14 @@ hints.ai_flags = gateway_ports ? AI_PASSIVE : 0; hints.ai_socktype = SOCK_STREAM; snprintf(strport, sizeof strport, "%d", listen_port); - if (getaddrinfo(NULL, strport, &hints, &aitop) != 0) + if (mygetaddrinfo(NULL, strport, &hints, &aitop) != 0) packet_disconnect("getaddrinfo: fatal error"); for (ai = aitop; ai; ai = ai->ai_next) { - if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) + if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6 && + ai->ai_family != AF_LLC) continue; - if (getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, sizeof(ntop), + if (mygetnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, sizeof(ntop), strport, sizeof(strport), NI_NUMERICHOST|NI_NUMERICSERV) != 0) { error("channel_setup_fwd_listener: getnameinfo failed"); continue; @@ -2268,15 +2269,16 @@ hints.ai_family = IPv4or6; hints.ai_socktype = SOCK_STREAM; snprintf(strport, sizeof strport, "%d", port); - if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) { + if ((gaierr = mygetaddrinfo(host, strport, &hints, &aitop)) != 0) { error("connect_to %.100s: unknown host (%s)", host, gai_strerror(gaierr)); return -1; } for (ai = aitop; ai; ai = ai->ai_next) { - if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) + if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6 && + ai->ai_family != AF_LLC) continue; - if (getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, sizeof(ntop), + if (mygetnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, sizeof(ntop), strport, sizeof(strport), NI_NUMERICHOST|NI_NUMERICSERV) != 0) { error("connect_to: getnameinfo failed"); continue; @@ -2375,12 +2377,14 @@ hints.ai_flags = x11_use_localhost ? 0: AI_PASSIVE; hints.ai_socktype = SOCK_STREAM; snprintf(strport, sizeof strport, "%d", port); - if ((gaierr = getaddrinfo(NULL, strport, &hints, &aitop)) != 0) { + if ((gaierr = mygetaddrinfo(NULL, strport, &hints, &aitop)) != 0) { error("getaddrinfo: %.100s", gai_strerror(gaierr)); return -1; } for (ai = aitop; ai; ai = ai->ai_next) { - if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) + if (ai->ai_family != AF_INET && + ai->ai_family != AF_INET6 && + ai->ai_family != AF_LLC) continue; sock = socket(ai->ai_family, SOCK_STREAM, 0); if (sock < 0) { @@ -2542,7 +2546,7 @@ hints.ai_family = IPv4or6; hints.ai_socktype = SOCK_STREAM; snprintf(strport, sizeof strport, "%d", 6000 + display_number); - if ((gaierr = getaddrinfo(buf, strport, &hints, &aitop)) != 0) { + if ((gaierr = mygetaddrinfo(buf, strport, &hints, &aitop)) != 0) { error("%.100s: unknown host. (%s)", buf, gai_strerror(gaierr)); return -1; } diff -uNr openssh-3.6.1p2.orig/llc.h openssh-3.6.1p2.llc/llc.h --- openssh-3.6.1p2.orig/llc.h 1969-12-31 21:00:00.000000000 -0300 +++ openssh-3.6.1p2.llc/llc.h 2003-11-01 02:16:54.000000000 -0200 @@ -0,0 +1,80 @@ +#ifndef __LINUX_LLC_H +#define __LINUX_LLC_H +/* + * IEEE 802.2 User Interface SAPs for Linux, data structures and indicators. + * + * Copyright (c) 2001 by Jay Schulist + * + * This program can be redistributed or modified under the terms of the + * GNU General Public License as published by the Free Software Foundation. + * This program is distributed without any warranty or implied warranty + * of merchantability or fitness for a particular purpose. + * + * See the GNU General Public License for more details. + */ +#define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */ +struct sockaddr_llc { + sa_family_t sllc_family; /* AF_LLC */ + sa_family_t sllc_arphrd; /* ARPHRD_ETHER */ + unsigned char sllc_test; + unsigned char sllc_xid; + unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */ + unsigned char sllc_sap; + unsigned char sllc_mac[IFHWADDRLEN]; + unsigned char __pad[__LLC_SOCK_SIZE__ - sizeof(sa_family_t) * 2 - + sizeof(unsigned char) * 4 - IFHWADDRLEN]; +}; + +/* sockopt definitions. */ +enum llc_sockopts { + LLC_OPT_UNKNOWN = 0, + LLC_OPT_RETRY, /* max retrans attempts. */ + LLC_OPT_SIZE, /* max PDU size (octets). */ + LLC_OPT_ACK_TMR_EXP, /* ack expire time (secs). */ + LLC_OPT_P_TMR_EXP, /* pf cycle expire time (secs). */ + LLC_OPT_REJ_TMR_EXP, /* rej sent expire time (secs). */ + LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */ + LLC_OPT_TX_WIN, /* tx window size. */ + LLC_OPT_RX_WIN, /* rx window size. */ + LLC_OPT_MAX +}; + +#define LLC_OPT_MAX_RETRY 100 +#define LLC_OPT_MAX_SIZE 4196 +#define LLC_OPT_MAX_WIN 127 +#define LLC_OPT_MAX_ACK_TMR_EXP 60 +#define LLC_OPT_MAX_P_TMR_EXP 60 +#define LLC_OPT_MAX_REJ_TMR_EXP 60 +#define LLC_OPT_MAX_BUSY_TMR_EXP 60 + +/* LLC SAP types. */ +#define LLC_SAP_NULL 0x00 /* NULL SAP. */ +#define LLC_SAP_LLC 0x02 /* LLC Sublayer Managment. */ +#define LLC_SAP_SNA 0x04 /* SNA Path Control. */ +#define LLC_SAP_PNM 0x0E /* Proway Network Managment. */ +#define LLC_SAP_IP 0x06 /* TCP/IP. */ +#define LLC_SAP_BSPAN 0x42 /* Bridge Spanning Tree Proto */ +#define LLC_SAP_MMS 0x4E /* Manufacturing Message Srv. */ +#define LLC_SAP_8208 0x7E /* ISO 8208 */ +#define LLC_SAP_3COM 0x80 /* 3COM. */ +#define LLC_SAP_PRO 0x8E /* Proway Active Station List */ +#define LLC_SAP_SNAP 0xAA /* SNAP. */ +#define LLC_SAP_BANYAN 0xBC /* Banyan. */ +#define LLC_SAP_IPX 0xE0 /* IPX/SPX. */ +#define LLC_SAP_NETBEUI 0xF0 /* NetBEUI. */ +#define LLC_SAP_LANMGR 0xF4 /* LanManager. */ +#define LLC_SAP_IMPL 0xF8 /* IMPL */ +#define LLC_SAP_DISC 0xFC /* Discovery */ +#define LLC_SAP_OSI 0xFE /* OSI Network Layers. */ +#define LLC_SAP_LAR 0xDC /* LAN Address Resolution */ +#define LLC_SAP_RM 0xD4 /* Resource Management */ +#define LLC_SAP_GLOBAL 0xFF /* Global SAP. */ + +#ifdef __KERNEL__ +#define LLC_SAP_DYN_START 0xC0 +#define LLC_SAP_DYN_STOP 0xDE +#define LLC_SAP_DYN_TRIES 4 + +#define llc_ui_skb_cb(__skb) ((struct sockaddr_llc *)&((__skb)->cb[0])) +#endif /* __KERNEL__ */ +#endif /* __LINUX_LLC_H */ diff -uNr openssh-3.6.1p2.orig/misc.c openssh-3.6.1p2.llc/misc.c --- openssh-3.6.1p2.orig/misc.c 2003-10-26 18:54:18.000000000 -0200 +++ openssh-3.6.1p2.llc/misc.c 2003-11-01 15:07:54.000000000 -0200 @@ -28,6 +28,14 @@ #include "misc.h" #include "log.h" #include "xmalloc.h" +#include +#include +#if 0 +#include +// till we have this header in glibc-devel +#else +#include "llc.h" +#endif /* remove newline at end of string */ char * @@ -352,3 +360,106 @@ return (signal(sig, act)); #endif } + +int +llcgetaddrinfo(const char *node, const char *service, + const struct addrinfo *hints, + struct addrinfo **res) +{ + char *x; + unsigned char port; + struct ether_addr e; + struct addrinfo *ai; + struct sockaddr_llc *sllc; + int rc = EAI_NONAME; + + if (node && !ether_aton_r(node, &e) && ether_hostton(node, &e)) + goto out; + rc = EAI_MEMORY; + ai = malloc(sizeof(*ai)); + if (!ai) + goto out_mem_ai; + sllc = malloc(sizeof(*sllc)); + if (!sllc) + goto out_mem_sllc; + memset(ai, 0, sizeof(*ai)); + memset(sllc, 0, sizeof(*sllc)); + ai->ai_next = 0; + ai->ai_family = AF_LLC; + ai->ai_socktype = SOCK_STREAM; + ai->ai_addrlen = sizeof(*sllc); + ai->ai_addr = (struct sockaddr *)sllc; + sllc->sllc_family = AF_LLC; + sllc->sllc_arphrd = ARPHRD_ETHER; + port = strtol(service ? service : "0", &x, 0); + if (*x) { /* service is not numeric */ + struct servent* se = getservbyname(service, "llc"); + + rc = EAI_SERVICE; + if (!se) + goto out_service; + port = se->s_port; + } + if (node) + memcpy(sllc->sllc_mac, e.ether_addr_octet, IFHWADDRLEN); + sllc->sllc_sap = port; + rc = 0; + *res = ai; +out: + return rc; +out_service: + free(sllc); +out_mem_sllc: + free(ai); +out_mem_ai: + rc = EAI_MEMORY; + goto out; +} + +int +mygetaddrinfo(const char *node, const char *service, + const struct addrinfo *hints, + struct addrinfo **res) +{ + if (hints->ai_family == AF_LLC) + return llcgetaddrinfo(node, service, hints, res); + return getaddrinfo(node, service, hints, res); +} + +int llcgetnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, + size_t hostlen, char *serv, size_t servlen, int flags) +{ + struct sockaddr_llc *sllc = (struct sockaddr_llc *)sa; + + if (host && hostlen > 0) { /* resolve host */ + char name[64]; + struct ether_addr *eth = (struct ether_addr *)sllc->sllc_mac; + if ((flags & NI_NUMERICHOST) || + ether_ntohost(name, eth)) + ether_ntoa_r(eth, name); + strncpy(host, name, hostlen - 1); + host[hostlen - 1] = '\0'; + } + if (serv && servlen > 0) { /* resolve service */ + struct servent *s; + + snprintf(serv, servlen - 1, "%d", sllc->sllc_sap); + + if (!(flags & NI_NUMERICHOST) && + (s = getservbyport(sllc->sllc_sap, "llc") != NULL)) + strncpy(serv, s->s_name, servlen - 1); + serv[servlen - 1] = '\0'; + } + return 0; +} + +int mygetnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, + size_t hostlen, char *serv, size_t servlen, int flags) +{ + sa_family_t f = ((struct sockaddr_storage *)sa)->ss_family; + + if (f == AF_LLC) + return llcgetnameinfo(sa, salen, host, hostlen, + serv, servlen, flags); + return getnameinfo(sa, salen, host, hostlen, serv, servlen, flags); +} diff -uNr openssh-3.6.1p2.orig/misc.h openssh-3.6.1p2.llc/misc.h --- openssh-3.6.1p2.orig/misc.h 2002-03-21 23:54:25.000000000 -0300 +++ openssh-3.6.1p2.llc/misc.h 2003-10-27 23:30:12.000000000 -0200 @@ -35,3 +35,15 @@ /* wrapper for signal interface */ typedef void (*mysig_t)(int); mysig_t mysignal(int sig, mysig_t act); + +#ifndef AF_LLC +#define AF_LLC 26 +#endif + +int mygetaddrinfo(const char *node, const char *service, + const struct addrinfo *hints, + struct addrinfo **res); +int mygetnameinfo(const struct sockaddr *sa, socklen_t salen, + char *host, size_t hostlen, char *serv, + size_t servlen, int flags); + diff -uNr openssh-3.6.1p2.orig/packet.c openssh-3.6.1p2.llc/packet.c --- openssh-3.6.1p2.orig/packet.c 2003-04-01 08:43:39.000000000 -0300 +++ openssh-3.6.1p2.llc/packet.c 2003-10-29 00:49:56.000000000 -0200 @@ -174,7 +174,8 @@ return 0; if (fromlen != tolen || memcmp(&from, &to, fromlen) != 0) return 0; - if (from.ss_family != AF_INET && from.ss_family != AF_INET6) + if (from.ss_family != AF_INET && from.ss_family != AF_INET6 && + from.ss_family != AF_LLC) return 0; return 1; } diff -uNr openssh-3.6.1p2.orig/scp.c openssh-3.6.1p2.llc/scp.c --- openssh-3.6.1p2.orig/scp.c 2003-03-20 21:55:32.000000000 -0300 +++ openssh-3.6.1p2.llc/scp.c 2003-11-03 16:29:10.000000000 -0200 @@ -225,12 +225,13 @@ addargs(&args, "-oClearAllForwardings yes"); fflag = tflag = 0; - while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q1246S:o:F:")) != -1) + while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q12456S:o:F:")) != -1) switch (ch) { /* User-visible flags. */ case '1': case '2': case '4': + case '5': case '6': case 'C': addargs(&args, "-%c", ch); @@ -1029,7 +1030,7 @@ usage(void) { (void) fprintf(stderr, - "usage: scp [-pqrvBC1246] [-F config] [-S program] [-P port]\n" + "usage: scp [-pqrvBC12456] [-F config] [-S program] [-P port]\n" " [-c cipher] [-i identity] [-l limit] [-o option]\n" " [[user@]host1:]file1 [...] [[user@]host2:]file2\n"); exit(1); diff -uNr openssh-3.6.1p2.orig/servconf.c openssh-3.6.1p2.llc/servconf.c --- openssh-3.6.1p2.orig/servconf.c 2003-02-23 22:04:34.000000000 -0300 +++ openssh-3.6.1p2.llc/servconf.c 2003-10-26 22:43:17.000000000 -0200 @@ -43,7 +43,7 @@ static void add_listen_addr(ServerOptions *, char *, u_short); static void add_one_listen_addr(ServerOptions *, char *, u_short); -/* AF_UNSPEC or AF_INET or AF_INET6 */ +/* AF_UNSPEC or AF_INET or AF_INET6 or AF_LLC */ extern int IPv4or6; /* Use of privilege separation or not */ extern int use_privsep; @@ -428,7 +428,7 @@ hints.ai_socktype = SOCK_STREAM; hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0; snprintf(strport, sizeof strport, "%u", port); - if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0) + if ((gaierr = mygetaddrinfo(addr, strport, &hints, &aitop)) != 0) fatal("bad addr or host: %s (%s)", addr ? addr : "", gai_strerror(gaierr)); diff -uNr openssh-3.6.1p2.orig/ssh-keyscan.c openssh-3.6.1p2.llc/ssh-keyscan.c --- openssh-3.6.1p2.orig/ssh-keyscan.c 2003-02-23 22:03:03.000000000 -0300 +++ openssh-3.6.1p2.llc/ssh-keyscan.c 2003-10-29 00:47:59.000000000 -0200 @@ -29,7 +29,8 @@ #include "atomicio.h" #include "misc.h" -/* Flag indicating whether IPv4 or IPv6. This can be set on the command line. +/* Flag indicating whether IPv4, IPv6 or LLC. This can be set on the command + line. Default value is AF_UNSPEC means both IPv4 and IPv6. */ #ifdef IPV4_DEFAULT int IPv4or6 = AF_INET; @@ -394,7 +395,7 @@ memset(&hints, 0, sizeof(hints)); hints.ai_family = IPv4or6; hints.ai_socktype = SOCK_STREAM; - if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) + if ((gaierr = mygetaddrinfo(host, strport, &hints, &aitop)) != 0) fatal("getaddrinfo %s: %s", host, gai_strerror(gaierr)); for (ai = aitop; ai; ai = ai->ai_next) { s = socket(ai->ai_family, SOCK_STREAM, 0); @@ -709,7 +710,7 @@ if (argc <= 1) usage(); - while ((opt = getopt(argc, argv, "v46p:T:t:f:")) != -1) { + while ((opt = getopt(argc, argv, "v456p:T:t:f:")) != -1) { switch (opt) { case 'p': ssh_port = a2port(optarg); @@ -764,6 +765,9 @@ case '4': IPv4or6 = AF_INET; break; + case '5': + IPv4or6 = AF_LLC; + break; case '6': IPv4or6 = AF_INET6; break; diff -uNr openssh-3.6.1p2.orig/ssh.c openssh-3.6.1p2.llc/ssh.c --- openssh-3.6.1p2.orig/ssh.c 2003-10-26 18:54:18.000000000 -0200 +++ openssh-3.6.1p2.llc/ssh.c 2003-10-26 19:10:18.000000000 -0200 @@ -79,7 +79,8 @@ char *__progname; #endif -/* Flag indicating whether IPv4 or IPv6. This can be set on the command line. +/* Flag indicating whether IPv4, IPv6 or LLC. This can be set on the command + line. Default value is AF_UNSPEC means both IPv4 and IPv6. */ #ifdef IPV4_DEFAULT int IPv4or6 = AF_INET; @@ -275,7 +276,7 @@ again: while ((opt = getopt(ac, av, - "1246ab:c:e:fgi:kl:m:no:p:qstvxACD:F:I:L:NPR:TVX")) != -1) { + "12456ab:c:e:fgi:kl:m:no:p:qstvxACD:F:I:L:NPR:TVX")) != -1) { switch (opt) { case '1': options.protocol = SSH_PROTO_1; @@ -286,6 +287,9 @@ case '4': IPv4or6 = AF_INET; break; + case '5': + IPv4or6 = AF_LLC; + break; case '6': IPv4or6 = AF_INET6; break; diff -uNr openssh-3.6.1p2.orig/sshconnect.c openssh-3.6.1p2.llc/sshconnect.c --- openssh-3.6.1p2.orig/sshconnect.c 2002-12-23 00:06:20.000000000 -0200 +++ openssh-3.6.1p2.llc/sshconnect.c 2003-10-29 00:51:22.000000000 -0200 @@ -195,7 +195,7 @@ hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; - gaierr = getaddrinfo(options.bind_address, "0", &hints, &res); + gaierr = mygetaddrinfo(options.bind_address, "0", &hints, &res); if (gaierr) { error("getaddrinfo: %s: %s", options.bind_address, gai_strerror(gaierr)); @@ -267,7 +267,7 @@ hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; snprintf(strport, sizeof strport, "%u", port); - if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) + if ((gaierr = mygetaddrinfo(host, strport, &hints, &aitop)) != 0) fatal("%s: %.100s: %s", __progname, host, gai_strerror(gaierr)); @@ -283,9 +283,11 @@ /* Loop through addresses for this host, and try each one in sequence until the connection succeeds. */ for (ai = aitop; ai; ai = ai->ai_next) { - if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) + if (ai->ai_family != AF_INET && + ai->ai_family != AF_INET6 && + ai->ai_family != AF_LLC) continue; - if (getnameinfo(ai->ai_addr, ai->ai_addrlen, + if (mygetnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, sizeof(ntop), strport, sizeof(strport), NI_NUMERICHOST|NI_NUMERICSERV) != 0) { error("ssh_connect: getnameinfo failed"); @@ -536,7 +538,7 @@ * using a proxy command */ if (options.proxy_command == NULL) { - if (getnameinfo(hostaddr, salen, ntop, sizeof(ntop), + if (mygetnameinfo(hostaddr, salen, ntop, sizeof(ntop), NULL, 0, NI_NUMERICHOST) != 0) fatal("check_host_key: getnameinfo failed"); ip = xstrdup(ntop); diff -uNr openssh-3.6.1p2.orig/sshd.c openssh-3.6.1p2.llc/sshd.c --- openssh-3.6.1p2.orig/sshd.c 2003-03-09 21:38:10.000000000 -0300 +++ openssh-3.6.1p2.llc/sshd.c 2003-10-29 00:51:26.000000000 -0200 @@ -109,7 +109,8 @@ char *config_file_name = _PATH_SERVER_CONFIG_FILE; /* - * Flag indicating whether IPv4 or IPv6. This can be set on the command line. + * Flag indicating whether IPv4, IPv6 or LLC. This can be set on the command + * line. * Default value is AF_UNSPEC means both IPv4 and IPv6. */ #ifdef IPV4_DEFAULT @@ -843,11 +844,14 @@ initialize_server_options(&options); /* Parse command-line arguments. */ - while ((opt = getopt(ac, av, "f:p:b:k:h:g:V:u:o:dDeiqtQ46")) != -1) { + while ((opt = getopt(ac, av, "f:p:b:k:h:g:V:u:o:dDeiqtQ456")) != -1) { switch (opt) { case '4': IPv4or6 = AF_INET; break; + case '5': + IPv4or6 = AF_LLC; + break; case '6': IPv4or6 = AF_INET6; break; @@ -1141,12 +1145,14 @@ generate_ephemeral_server_key(); } else { for (ai = options.listen_addrs; ai; ai = ai->ai_next) { - if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) + if (ai->ai_family != AF_INET && + ai->ai_family != AF_INET6 && + ai->ai_family != AF_LLC) continue; if (num_listen_socks >= MAX_LISTEN_SOCKS) fatal("Too many listen sockets. " "Enlarge MAX_LISTEN_SOCKS"); - if (getnameinfo(ai->ai_addr, ai->ai_addrlen, + if (mygetnameinfo(ai->ai_addr, ai->ai_addrlen, ntop, sizeof(ntop), strport, sizeof(strport), NI_NUMERICHOST|NI_NUMERICSERV) != 0) { error("getnameinfo failed");