Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c2c06f3 authored by Bernie Innocenti's avatar Bernie Innocenti
Browse files

resolv: delete unused RES_F_* flags

 - RES_F_CONN was write-only (cleared, but never tested)
 - RES_F_LASTMASK / RES_F_LASTSHIFT were write-only
 - RES_GETLAST(flags) was never used
 - res_findzonecut2() doesn't exist

Test: atest resolv_integration_test
Change-Id: I513c039e3ce48fd8a13ee4d1aad3d6d051c3e856
parent 9676a3ac
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ void res_nclose(res_state statp) {
    if (statp->_vcsock >= 0) {
        (void) close(statp->_vcsock);
        statp->_vcsock = -1;
        statp->_flags &= ~(RES_F_VC | RES_F_CONN);
        statp->_flags &= ~RES_F_VC;
    }
    for (ns = 0; ns < statp->_u._ext.nscount; ns++) {
        if (statp->_u._ext.nssocks[ns] != -1) {
+0 −2
Original line number Diff line number Diff line
@@ -523,8 +523,6 @@ int res_nsend(res_state statp, const u_char* buf, int buflen, u_char* ans, int a
            *rcode = RCODE_INTERNAL_ERROR;
            nsap = get_nsaddr(statp, (size_t) ns);
            nsaplen = get_salen(nsap);
            statp->_flags &= ~RES_F_LASTMASK;
            statp->_flags |= (ns << RES_F_LASTSHIFT);

        same_ns:
            // TODO: Since we expect there is only one DNS server being queried here while this
+3 −15
Original line number Diff line number Diff line
@@ -144,21 +144,9 @@ void _res_stats_set_sample(res_sample* sample, time_t now, int rcode, int rtt);

/* End of stats related definitions */

/*
 * Resolver flags (used to be discrete per-module statics ints).
 */
#define RES_F_VC 0x00000001       /* socket is TCP */
#define RES_F_CONN 0x00000002     /* socket is connected */
#define RES_F_EDNS0ERR 0x00000004 /* EDNS0 caused errors */
#define RES_F__UNUSED 0x00000008  /* (unused) */
#define RES_F_LASTMASK 0x000000F0 /* ordinal server of last res_nsend */
#define RES_F_LASTSHIFT 4         /* bit position of LASTMASK "flag" */
#define RES_GETLAST(res) (((res)._flags & RES_F_LASTMASK) >> RES_F_LASTSHIFT)

/* res_findzonecut2() options */
#define RES_EXHAUSTIVE 0x00000001 /* always do all queries */
#define RES_IPV4ONLY 0x00000002   /* IPv4 only */
#define RES_IPV6ONLY 0x00000004   /* IPv6 only */
// Flags for res_state->_flags
#define RES_F_VC 0x00000001        // socket is TCP
#define RES_F_EDNS0ERR 0x00000004  // EDNS0 caused errors

/*
 * Resolver options (keep these in synch with res_debug.c, please)