Changeset 2ff150e in mainline


Ignore:
Timestamp:
2012-02-13T08:25:46Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
081971b
Parents:
fe4310f
Message:

Correct handling of IP protocol field.

Location:
uspace
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/e1k/e1k.c

    rfe4310f r2ff150e  
    23092309static void e1000_send_frame(nic_t *nic, void *data, size_t size)
    23102310{
    2311         printf("e1000_send_frame()\n");
    23122311        assert(nic);
    23132312       
  • uspace/srv/inet/addrobj.c

    rfe4310f r2ff150e  
    125125/** Send datagram to directly reachable destination */
    126126int inet_addrobj_send_dgram(inet_addrobj_t *addr, inet_dgram_t *dgram,
    127     uint8_t ttl, int df)
     127    uint8_t proto, uint8_t ttl, int df)
    128128{
    129129        inet_addr_t lsrc_addr;
     
    134134
    135135        return inet_link_send_dgram(addr->ilink, &lsrc_addr, ldest_addr, dgram,
    136             ttl, df);
     136            proto, ttl, df);
    137137}
    138138
  • uspace/srv/inet/addrobj.h

    rfe4310f r2ff150e  
    5353extern inet_addrobj_t *inet_addrobj_find(inet_addr_t *, inet_addrobj_find_t);
    5454extern int inet_addrobj_send_dgram(inet_addrobj_t *, inet_dgram_t *,
    55     uint8_t ttl, int df);
     55    uint8_t, uint8_t, int);
    5656
    5757#endif
  • uspace/srv/inet/inet.c

    rfe4310f r2ff150e  
    101101}
    102102
    103 static int inet_route_packet(inet_dgram_t *dgram, uint8_t ttl, int df)
     103static int inet_route_packet(inet_dgram_t *dgram, uint8_t proto, uint8_t ttl,
     104    int df)
    104105{
    105106        inet_addrobj_t *addr;
     
    108109        if (addr != NULL) {
    109110                /* Destination is directly accessible */
    110                 return inet_addrobj_send_dgram(addr, dgram, ttl, df);
     111                return inet_addrobj_send_dgram(addr, dgram, proto, ttl, df);
    111112        }
    112113
     
    117118
    118119static int inet_send(inet_client_t *client, inet_dgram_t *dgram,
    119     uint8_t ttl, int df)
    120 {
    121         return inet_route_packet(dgram, ttl, df);
     120    uint8_t proto, uint8_t ttl, int df)
     121{
     122        return inet_route_packet(dgram, proto, ttl, df);
    122123}
    123124
     
    177178        }
    178179
    179         rc = inet_send(client, &dgram, ttl, df);
     180        rc = inet_send(client, &dgram, client->protocol, ttl, df);
    180181
    181182        free(dgram.data);
  • uspace/srv/inet/inet_link.c

    rfe4310f r2ff150e  
    217217/** Send datagram over Internet link */
    218218int inet_link_send_dgram(inet_link_t *ilink, inet_addr_t *lsrc,
    219     inet_addr_t *ldest, inet_dgram_t *dgram, uint8_t ttl, int df)
     219    inet_addr_t *ldest, inet_dgram_t *dgram, uint8_t proto, uint8_t ttl, int df)
    220220{
    221221        iplink_sdu_t sdu;
     
    227227        packet.dest = dgram->dest;
    228228        packet.tos = dgram->tos;
    229         packet.proto = 42;
     229        packet.proto = proto;
    230230        packet.ttl = ttl;
    231231        packet.df = df;
  • uspace/srv/inet/inet_link.h

    rfe4310f r2ff150e  
    4242extern int inet_link_discovery_start(void);
    4343extern int inet_link_send_dgram(inet_link_t *, inet_addr_t *,
    44     inet_addr_t *, inet_dgram_t *, uint8_t, int);
     44    inet_addr_t *, inet_dgram_t *, uint8_t, uint8_t, int);
    4545
    4646#endif
  • uspace/srv/inet/pdu.c

    rfe4310f r2ff150e  
    7373            BIT_V(uint16_t, FF_FLAG_DF) : 0);
    7474        hdr->ttl = packet->ttl;
    75         hdr->proto = 0;
     75        hdr->proto = packet->proto;
    7676        hdr->chksum = 0;
    7777        hdr->src_addr = host2uint32_t_be(packet->src.ipv4);
     
    125125        /* XXX Flags */
    126126        /* XXX Fragment offset */
    127         /* XXX Protocol */
    128127        /* XXX Checksum */
    129128
     
    131130        packet->dest.ipv4 = uint32_t_be2host(hdr->dest_addr);
    132131        packet->tos = hdr->tos;
     132        packet->proto = hdr->proto;
    133133        packet->ttl = hdr->ttl;
    134134        packet->df = (uint16_t_be2host(hdr->tos) & BIT_V(uint16_t, FF_FLAG_DF))
Note: See TracChangeset for help on using the changeset viewer.