-/* ns_output.c 6.2 85/06/01 */
+/*
+ * Copyright (c) 1982 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ * @(#)ns_output.c 6.6 (Berkeley) %G%
+ */
#include "param.h"
#include "mbuf.h"
{
register struct idp *idp = mtod(m0, struct idp *);
register struct ifnet *ifp;
- register struct mbuf *m;
- int len, rlen, off, error = 0;
+ int error = 0;
struct route idproute;
struct sockaddr_ns *dst;
extern int idpcksum;
- if(ns_hold_output) {
- if(ns_lastout) {
+ if (ns_hold_output) {
+ if (ns_lastout) {
m_free(ns_lastout);
}
- ns_lastout = m_copy(m0, 0, M_COPYALL);
+ ns_lastout = m_copy(m0, 0, (int)M_COPYALL);
}
- if(ns_copy_output) {
+ if (ns_copy_output) {
ns_watch_output(m0);
}
if (ro->ro_rt == 0) {
dst->sns_family = AF_NS;
dst->sns_addr = idp->idp_dna;
+ dst->sns_addr.x_port = 0;
/*
* If routing to interface only,
* short circuit routing lookup.
*/
if (flags & NS_ROUTETOIF) {
struct ns_ifaddr *ia;
+ struct ifaddr *ifa_ifwithdstaddr();
+
ia = ns_iaonnetof(idp->idp_dna.x_net);
if (ia == 0) {
error = ENETUNREACH;
goto bad;
}
ifp = ia->ia_ifp;
+ if (ifp->if_flags & IFF_POINTOPOINT) {
+ ia = (struct ns_ifaddr *)
+ ifa_ifwithdstaddr(&ro->ro_dst);
+ if (ia == 0) {
+ error = ENETUNREACH;
+ goto bad;
+ }
+ ifp = ia->ia_ifp;
+ }
goto gotif;
}
rtalloc(ro);