slirp updates
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOjpdRkZg6GdhDKQnmWhJwc9WBHgFAlpbkRwACgkQmWhJwc9W BHjCVw/9FuebLWQl8BDnaRt31qlxTFegJazWRRQyQnqjBcwT3kAAPBDTDkvJRa+Y L6bwuOM6RRS8dHK7Kf9Af5jxPlFhgOiqtfrOBmD3nYaVSMZ/K/xSlZpt1b8CEqfi l9IqPfXwV1yTHRDdJ8RNOP3LOlpkzK/wvzVw83lDkaN7uKv+LCNQ/CAy3KlCNHRn nc3OHI4DhKsSH17NggZiXFifbwJ3OISV42uBbpPVF6yJLtaVZtCOA5xsUIaOR043 INe8o8pTcPtZ2rnMtNa+VQMdxVJTtssd+QwEDktEvI8RSCrwvQhUuw5RL88TNUdd Rw03qlQbVh6J17a3fDFj1qDY5Eu63kF9DothoWhe/Kky4ROqZyQwdpHFDWZb0Jzb LDOftTFL5Oa00GiWtE2FLrM7C4omlCCeUAzhnLeTYVGTaK+hn/ugTvE4ySAQUSgj TONvitIPRigivaqCRsGa0F+RIpJxQORPkLFKSIYW7dMCMgFq2YiTcg6TsEnhYrIH 8diE7pjexsTlFUEg5jelJPHAS6IdGg3l+UEq2twVnkeIfHAdkaDKlUS9z3J0iM+K 5cMKBwok5rOti+3imJ3hoEhwn2bvN9lio+u7Y9YY3wRF2OQuFyK2zc89aAbHVmj0 J90lF5VxwD64F7hexd6MwKLgvxdgILU7xsMAVPswVPdweztW+EI= =p5qP -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging slirp updates # gpg: Signature made Sun 14 Jan 2018 17:19:24 GMT # gpg: using RSA key 0x996849C1CF560478 # gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>" # gpg: aka "Samuel Thibault <sthibault@debian.org>" # gpg: aka "Samuel Thibault <samuel.thibault@gnu.org>" # gpg: aka "Samuel Thibault <samuel.thibault@inria.fr>" # gpg: aka "Samuel Thibault <samuel.thibault@labri.fr>" # gpg: aka "Samuel Thibault <samuel.thibault@ens-lyon.org>" # gpg: aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 900C B024 B679 31D4 0F82 304B D017 8C76 7D06 9EE6 # Subkey fingerprint: 3A3A 5D46 4660 E867 610C A427 9968 49C1 CF56 0478 * remotes/thibault/tags/samuel-thibault: slirp: add in6_dhcp_multicast() slirp: removed unused code slirp: remove unnecessary struct declaration slirp: remove unused header slirp: avoid IN6_IS_ADDR_UNSPECIFIED(), rather use in6_zero() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
fd06527b80
@ -17,6 +17,9 @@
|
||||
0x00, 0x00, 0x00, 0x00,\
|
||||
0x00, 0x01, 0x00, 0x02 } }
|
||||
|
||||
#define in6_dhcp_multicast(a)\
|
||||
in6_equal(a, &(struct in6_addr)ALLDHCP_MULTICAST)
|
||||
|
||||
void dhcpv6_input(struct sockaddr_in6 *srcsas, struct mbuf *m);
|
||||
|
||||
#endif
|
||||
|
13
slirp/ip.h
13
slirp/ip.h
@ -233,17 +233,4 @@ struct ipasfrag {
|
||||
#define ipf_next ipf_link.next
|
||||
#define ipf_prev ipf_link.prev
|
||||
|
||||
/*
|
||||
* Structure stored in mbuf in inpcb.ip_options
|
||||
* and passed to ip_output when ip options are in use.
|
||||
* The actual length of the options (including ipopt_dst)
|
||||
* is in m_len.
|
||||
*/
|
||||
#define MAX_IPOPTLEN 40
|
||||
|
||||
struct ipoption {
|
||||
struct in_addr ipopt_dst; /* first-hop dst if source routed */
|
||||
int8_t ipopt_list[MAX_IPOPTLEN]; /* options proper */
|
||||
} QEMU_PACKED;
|
||||
|
||||
#endif
|
||||
|
@ -77,7 +77,7 @@ void icmp6_send_error(struct mbuf *m, uint8_t type, uint8_t code)
|
||||
DEBUG_ARGS((dfd, " type = %d, code = %d\n", type, code));
|
||||
|
||||
if (IN6_IS_ADDR_MULTICAST(&ip->ip_src) ||
|
||||
IN6_IS_ADDR_UNSPECIFIED(&ip->ip_src)) {
|
||||
in6_zero(&ip->ip_src)) {
|
||||
/* TODO icmp error? */
|
||||
return;
|
||||
}
|
||||
@ -272,7 +272,7 @@ static void ndp_send_na(Slirp *slirp, struct ip6 *ip, struct icmp6 *icmp)
|
||||
struct mbuf *t = m_get(slirp);
|
||||
struct ip6 *rip = mtod(t, struct ip6 *);
|
||||
rip->ip_src = icmp->icmp6_nns.target;
|
||||
if (IN6_IS_ADDR_UNSPECIFIED(&ip->ip_src)) {
|
||||
if (in6_zero(&ip->ip_src)) {
|
||||
rip->ip_dst = (struct in6_addr)ALLNODES_MULTICAST;
|
||||
} else {
|
||||
rip->ip_dst = ip->ip_src;
|
||||
@ -350,7 +350,7 @@ static void ndp_input(struct mbuf *m, Slirp *slirp, struct ip6 *ip,
|
||||
&& icmp->icmp6_code == 0
|
||||
&& !IN6_IS_ADDR_MULTICAST(&icmp->icmp6_nns.target)
|
||||
&& ntohs(ip->ip_pl) >= ICMP6_NDP_NS_MINLEN
|
||||
&& (!IN6_IS_ADDR_UNSPECIFIED(&ip->ip_src)
|
||||
&& (!in6_zero(&ip->ip_src)
|
||||
|| in6_solicitednode_multicast(&ip->ip_dst))) {
|
||||
if (in6_equal_host(&icmp->icmp6_nns.target)) {
|
||||
/* Gratuitous NDP */
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#include "qemu-common.h"
|
||||
|
||||
struct Slirp;
|
||||
typedef struct Slirp Slirp;
|
||||
|
||||
int get_dns_addr(struct in_addr *pdns_addr);
|
||||
|
@ -23,7 +23,7 @@ void ndp_table_add(Slirp *slirp, struct in6_addr ip_addr,
|
||||
ethaddr[0], ethaddr[1], ethaddr[2],
|
||||
ethaddr[3], ethaddr[4], ethaddr[5]));
|
||||
|
||||
if (IN6_IS_ADDR_MULTICAST(&ip_addr) || IN6_IS_ADDR_UNSPECIFIED(&ip_addr)) {
|
||||
if (IN6_IS_ADDR_MULTICAST(&ip_addr) || in6_zero(&ip_addr)) {
|
||||
/* Do not register multicast or unspecified addresses */
|
||||
DEBUG_CALL(" abort: do not register multicast or unspecified address");
|
||||
return;
|
||||
@ -60,7 +60,7 @@ bool ndp_table_search(Slirp *slirp, struct in6_addr ip_addr,
|
||||
DEBUG_ARG("ip = %s", addrstr);
|
||||
#endif
|
||||
|
||||
assert(!IN6_IS_ADDR_UNSPECIFIED(&ip_addr));
|
||||
assert(!in6_zero(&ip_addr));
|
||||
|
||||
/* Multicast address: fec0::abcd:efgh/8 -> 33:33:ab:cd:ef:gh */
|
||||
if (IN6_IS_ADDR_MULTICAST(&ip_addr)) {
|
||||
|
@ -1,7 +1,6 @@
|
||||
#ifndef SLIRP_H
|
||||
#define SLIRP_H
|
||||
|
||||
#include "qemu/host-utils.h"
|
||||
#include "slirp_config.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -65,7 +65,7 @@ void udp6_input(struct mbuf *m)
|
||||
/* handle DHCPv6 */
|
||||
if (ntohs(uh->uh_dport) == DHCPV6_SERVER_PORT &&
|
||||
(in6_equal(&ip->ip_dst, &slirp->vhost_addr6) ||
|
||||
in6_equal(&ip->ip_dst, &(struct in6_addr)ALLDHCP_MULTICAST))) {
|
||||
in6_dhcp_multicast(&ip->ip_dst))) {
|
||||
m->m_data += iphlen;
|
||||
m->m_len -= iphlen;
|
||||
dhcpv6_input(&lhost, m);
|
||||
|
Loading…
Reference in New Issue
Block a user