Commit Graph
4 Commits
Author SHA1 Message Date
vulcainman 380364bd5a Add tests concerning question QU bit 2026-04-06 17:12:27 +08:00
vulcainman 2f0d514df0 Remove the unused NOT_QU_MASK constant
The code using this constant was removed by the commit
a7a0b78b41219b40d28d71232f79f8170f528f30
2026-04-06 17:12:22 +08:00
vulcainman 8d78b4b53a Fix several lint issues
This commit includes several fixes that addess lint issues introduced by
commit a7a0b78b41219b40d28d71232f79f8170f528f30
2026-04-06 17:12:19 +08:00
vulcainman dfe5e3f86b Implement QU bit support in question encoder/decoder
This commit fix current QU bit implementation that may be used in mDNS
protocol. Indeed, until now, if a packet with QU bit set is received,
it is decoded as:

{

  ...

  questions: [
    {
      name: '...',
      type: 'PTR',
      class: 'UNKNOWN_32769'
    },
    {
      name: '...',
      type: 'PTR',
      class: 'UNKNOWN_32769'
    }
  ],

  ...

}

Instead of :

{

  ...

  questions: [
    {
      name: '...',
      type: 'PTR',
      class: 'IN'
    },
    {
      name: '...',
      type: 'PTR',
      class: 'IN'
    }
  ],

  ...

}

This commit adds a proper QU bit support via the qu_bit field.
It enables:

- The encoder to parse properly both the class and the QU bit
- THe decoder to encode a DNS packet with the QU bit set
2026-04-06 17:12:11 +08:00